<?php
# !!!!!!!!!! DON'T MAKE ANY CHANGE IF YOU DON'T KNOW WHAT YOU'RE DOING !!!!!!!!!!
// --------------------------------------------------------------------------------------------------------------
// File Name              :	header.php
// Last Modification Time	:	2008-02-01 24:00
// Last Modified by       :	turker (turker.biz@gmail.com)
// list of modifications	:
//
//	- 2008-02-01 turker
//		* 24:00 file created.
//
// --------------------------------------------------------------------------------------------------------------
if (eregi("header.php",$_SERVER['PHP_SELF'])) {
	header ("Location:../index.php");
	exit;
}

global $page;
setMeta($page);
$hook->beforeHeader();

echo <<<html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Content-Language" content="tr" />
	<meta http-equiv="imagetoolbar" content="no" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="-1" />
	<meta http-equiv="Cache-Control" content="no-cache" />
  <meta name="MSSmartTagsPreventParsing" content="true" />
	<meta name="description" content="Petsworld Petshop - Ankara" />
  <meta name="generator" content="turker" />
  <meta name="keywords" content="$SITE_KEYS" />
  <title>$SITE_TITLE</title>
  <base href="$SITE_URL/" />
  <link rel="stylesheet" href="template/layout.css" type="text/css" media="screen" />
  <link rel="shortcut icon" href="favicon.ico">
  <script type="text/JavaScript" src="template/jquery1.2.2.js"></script>
  <script type="text/JavaScript" src="template/javascript.js"></script>
html;

$q=$mysql->query("select count(id) as total from $BRANDS_TABLE where active='1'");
if ($mysql->result($q,'total')>0) {
  echo ' <script type="text/javascript" src="template/jcarousellite_1.0.1.js"></script>';
  echo ' <script type="text/javascript">
  $(document).ready(function(){
    $(".markalar").jCarouselLite({
      btnNext: "",
      btnPrev: "",
      auto: 3000,
      speed: 750,
      vertical: true
    });});</script>';
}

if (isAdmin()) {
  echo '<link rel="stylesheet" href="template/admin.css" type="text/css" media="screen" />';
  echo '<script type="text/JavaScript" src="template/admin.js"></script>';
}
if ($page=='item'||$page=='myinfo') {
  echo <<<html
  <link rel="stylesheet" href="template/tabber.css" type="text/css" media="screen" />
  <script type="text/javascript" src="template/tabber.js"></script>
  <link rel="stylesheet" href="template/src/css/shadowbox.css" type="text/css" media="screen" />
  <script type="text/javascript" src="template/src/js/adapter/shadowbox-jquery.js"></script>
  <script type="text/javascript" src="template/src/js/shadowbox.js"></script>
  <script type="text/javascript">
  $(document).ready(function(){
    var SHBoxOptions = {
      displayNav: false,
      handleUnsupported: 'remove',
      keysClose: ['c', 27] // c or esc
    };
    Shadowbox.init(SHBoxOptions);
  });</script>
html;
}

$hook->inHeader();
echo '</head><body>';
$hook->afterHeader();

if ($page!='basket'&&$page!='orders') {

  $date=strftime('%d %B %Y %A');
  $date=iconv("ISO-8859-9", "UTF-8",$date);

  echo <<<html
  <div id="container">
  <!--div:header_ust -->
    <div id="header_ust">
      <div id="header_tarih">$date</div>
    </div>
  <!--div://header_ust -->
  <!--div:logo_tab -->
    <div id="logo_tab">
      <div id="markalar" class="markalar">
html;

  $brands=getBrands();
  if ($brands) {
    $k=1;
    echo '<ul><li>';
    for ($i=0;$i<count($brands);$i++) {
      // id, title, name, image, date, order, active
      $brand=$brands[$i];
      $id=$brand['id'];
      $title=$prep->html($brand['title']);
      $name=$brand['name'];
      $image=$brand['image'];

      if (!empty($image)) {
        if (!$SITE_SEO)
          echo '<a href="index.php?page=brands&id='.$id.'" title="'.$title.'"><img src="img/brands/'.$image.'" alt="'.$title.'" /></a>';
        else
          echo '&nbsp;<a href="'.$SITE_URL.'/brands/'.$name.'" title="'.$title.'"><img src="img/brands/'.$image.'" alt="'.$title.'" /></a>&nbsp;';

        if (($k%$BRAND_PER_ROW==0)&&$i!=0) echo '</li><li>';
      }
      $k++;
    }
    echo '</li></ul>';
  }

  echo '</div>
    <img src="template/img/petsworld_logo.png">
    <div class="temizle"></div>
  </div>
<!--div://logo_tab -->';
  $hook->beforeTopMenu();

  echo '
<!--div:menu -->
  <div id="menu">
    <ul class="nav">';
  echo'<li class="here"><a href="'.$SITE_URL.'/" title="'.$_LANG['header']['homepage'].'">'.$_LANG['header']['homepage'].'</a></li>';
  if (!isLogged()) {
    if (!$SITE_SEO) {
      echo '<li><a href="index.php?page=login" title="'.$_LANG['header']['login'].'">'.$_LANG['header']['login'].'</a></li>'
           .'<li><a href="index.php?page=register" title="'.$_LANG['header']['register'].'">'.$_LANG['header']['register'].'</a></li>';
    }
    else {
      echo '<li><a href="'.$SITE_URL.'/login" title="'.$_LANG['header']['login'].'">'.$_LANG['header']['login'].'</a></li>'
           .'<li><a href="'.$SITE_URL.'/register" title="'.$_LANG['header']['register'].'">'.$_LANG['header']['register'].'</a></li>';
    }
  }
  echo listTopMenu();
  $hook->inTopMenu();
  if (isLogged()) {
    if (!$SITE_SEO) {
      echo '<li><a href="index.php?page=logout" title="'.$_LANG['header']['logout'].'">'.$_LANG['header']['logout'].'</a></li>';
      echo '<span style="float:right;padding:10px;">
            <a href="index.php?page=myinfo"><b>'.$_LANG['header']['myinfo'].'</b></a>&nbsp;&nbsp;
            <a href="index.php?page=mybasket"><b>'.$_LANG['header']['mybasket'].'</b></a>
            </span>';
    }
    else {
      echo '<li><a href="'.$SITE_URL.'/logout" title="'.$_LANG['header']['logout'].'">'.$_LANG['header']['logout'].'</a></li>';
      echo '<span style="float:right;padding:10px;">
            <a href="'.$SITE_URL.'/myinfo"><b>'.$_LANG['header']['myinfo'].'</b></a>&nbsp;&nbsp;
            <a href="'.$SITE_URL.'/mybasket"><b>'.$_LANG['header']['mybasket'].'</b></a>
            </span>';
    }

  }
  echo '</ul>
    </div>
  <!--div://menu -->';
  $hook->afterTopMenu();
}
?>
  <!--div:orta -->
  <div id="orta">